//package com.ricky;
//
//import org.springframework.boot.SpringApplication;
//import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
//import org.springframework.boot.autoconfigure.SpringBootApplication;
//import org.springframework.boot.builder.SpringApplicationBuilder;
//import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.servlet.http.HttpServletRequest;
//
///**
// * 另外一种方式
// * 外部容器方式
// */
////开启SpringBoot自动注入配置  等价于原来的SpringBootApplication
////开启RestController注解  含有ResponseBody 即非页面形式
//@RestController
//@EnableAutoConfiguration
//public class SpringBootApplicationServletInitializer extends SpringBootServletInitializer{
//
//    @GetMapping("/")
//    public String home(HttpServletRequest request) {
//        return "Hello World!";
//    }
//
//    @Override
//    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
//        //这里传入我们的配置类名
//        return builder.sources(SpringBootApplicationServletInitializer.class);
//    }
//
//    /**
//     * 用外部tomcat的话此项好像没啥屌用   生成的还是dev的log
//     */
//    public static void main(String[] args) {
//        args=new String[2];
//        System.out.println(args.toString());
//        //等价于 new SpringApplication(SpringBootApplication.class).run(args);
//        args[0]="--logging.level.root=info";
//        args[1]="--logging.file=d:/work/log/chapter02_add.log";
//        SpringApplication.run(SpringBootApplicationServletInitializer.class,args);
//    }
//}